home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / INTERNET / WI9609MA.ZIP / EMONITOR.JAV
Encoding:
Text File  |  1996-06-22  |  1.8 KB  |  78 lines

  1. import java.applet.*;
  2. import java.awt.*;
  3.  
  4.  
  5. public class emonitor extends Applet {
  6.  
  7.     public void init() {
  8.         myPanel mp = new myPanel();
  9.         myButton mb = new myButton("Press Me");
  10.         mp.add( mb );
  11.         add(mp);
  12.         
  13.     }
  14.  
  15.     public boolean postEvent(Event e) {
  16.         System.out.println("At postEvent() in Applet");
  17.         return super.postEvent(e);
  18.     }
  19.  
  20.     public boolean handleEvent(Event evt) {
  21.         System.out.println("At handleEvent() in Applet");
  22.         return super.handleEvent(evt);
  23.     }
  24.     public boolean action(Event evt, Object arg) {
  25.         System.out.println("At action() in Applet");
  26.         return super.action(evt,arg);  // The action method in all components return false by default
  27.     }
  28.  
  29. }
  30.  
  31. class myButton extends java.awt.Button {
  32.  
  33.     public myButton(String label) {
  34.         super(label);
  35.     }
  36.             
  37.     public boolean postEvent(Event e) {
  38.         System.out.println("At postEvent() in Button");
  39.         return super.postEvent(e);
  40.     }
  41.  
  42.     public boolean handleEvent(Event evt) {
  43.         System.out.println("At handleEvent() in Button");
  44.         return super.handleEvent(evt);
  45.     }
  46.     public boolean action(Event evt, Object arg) {
  47.             System.out.println("At action() in Button");
  48.             return super.action(evt,arg);  // The action method in all components return false by default
  49.     }
  50. }
  51.  
  52.         
  53.  
  54.  
  55. class myPanel extends java.awt.Panel {
  56.  
  57.     public myPanel()  {
  58.         super();
  59.     }
  60.             
  61.     public boolean postEvent(Event e) {
  62.         System.out.println("At postEvent() in Panel");
  63.         return super.postEvent(e);
  64.     }
  65.  
  66.     public boolean handleEvent(Event evt) {
  67.         System.out.println("At handleEvent() in Panel");
  68.         return super.handleEvent(evt);
  69.     }
  70.     public boolean action(Event evt, Object arg) {
  71.             System.out.println("At action() in Panel");
  72.             return super.action(evt,arg);  // The action method in all components return false by default
  73.     }
  74. }
  75.  
  76.         
  77.  
  78.